<template>
  <div class="home">
    <masks />
    <add />
    <list />
  </div>
</template>

<script>
import masks from "../components/Mask";
import add from "../components/Add";
import list from '../components/List'
export default {
  data() {
    return {};
  },
  methods: {},
  mounted() {},
  filters: {
    filtime: (val) => {
      let lastime = new Date(val);
      let cretime = new Date();
      let newtime = cretime - lastime;
      var str = "";
      if (newtime >= 0 && newtime < 1000 * 60 * 30) {
        str = "30分钟";
      } else if (newtime >= 1000 * 60 * 30 && newtime < 1000 * 60 * 60) {
        str = "1小时";
      } else if (newtime >= 1000 * 60 * 60 && newtime < 1000 * 60 * 60 * 24) {
        str = "1天";
      } else if (
        newtime >= 1000 * 60 * 60 * 24 &&
        newtime < 1000 * 60 * 60 * 24 * 7
      ) {
        str = "7天";
      } else {
        str = "一个月";
      }
      return str + "前";
    },
    // 时间过滤器  格式是 XX小时前
  },
  components: {
    add,
    masks,
    list
  },
};
</script>

<style lang="scss" scoped>
</style>